<template>
  <div>
    <!-- v-show隐藏css样式  v-if直接删除节点 -->
     <img src="./assets/44.png" alt="" v-show='flag'>
     <button @click="fn">点击隐藏和显示</button>
   </div>
</template>
 
<script>
export default {
  
  data() {
    return {
      flag: true,
    };
  },

  methods: {
    fn(){
      this.flag=!this.flag;
    }
  }
};
</script>

<style scoped>
     img{width: 500px;}
</style>